import 'dart:isolate';

int a = 0;
void main(List<String> args) {
  print("main starting...");
  Isolate.spawn(computeAdd, 10);
  print('a=$a');
  print("main ending...");
}

void computeAdd(int n) {
  int result = 0;
  for (int i = 0; i < n; i++) result += i;

  a = result;
  print("result:$result");
}
